{include file="common/head"/}
<style>
    .layui-form-pane .layui-form-label{
        width: 172px;
    }
</style>
<div class="admin-main layui-anim layui-anim-upbit">
    <fieldset class="layui-elem-field layui-field-title">
        <legend>酒店规则设置</legend>
    </fieldset>
    <form class="layui-form layui-form-pane">
        <input type="hidden" name="id" id="" value="1">
        <div class="layui-form-item">
            <label class="layui-form-label">微信回复</label>
            <div class="layui-input-4" style="width:80%;height:350px;">
                <textarea name="reply" id="" class="layui-textarea layui-input-6" style="min-height: 200px;">{$list.reply}</textarea>
            </div>
        </div>
        <div class="layui-form-item">
            <div class="layui-input-block">
                <button type="button" class="layui-btn" id="submit" lay-submit=""
                    lay-filter="sys">{:lang('submit')}</button>
            </div>
        </div>
    </form>
</div>
{include file="common/foot"/}
<script>
    var ue = UE.getEditor('privacy');
    ue.ready(function(){
        ue.addListener("contentChange", function () {
	        $('#privacy').val(ue.getContent());
        });
    })
    
    layui.use(['form', 'layer', 'upload'], function () {
        var form = layui.form, layer = layui.layer, upload = layui.upload, $ = layui.jquery;
       //提交监听
        form.on('submit(sys)', function (data) {
            $("#submit").attr({ disabled: "disabled" });
            loading = layer.load(1, { shade: [0.1, '#fff'] });
            $.post("{:url('wechat/reply')}", data.field, function (res) {
                layer.close(loading);
                if (res.errorCode == 8888) {
                    layer.msg(res.msg, { icon: 1, time: 1000 }, function () {
                        
                    });
                } else {
                    $("#submit").removeAttr("disabled");
                    layer.msg(res.msg, { icon: 2, time: 1000 });
                }
            });
        })
    })


</script>


</body>

</html>
